# coding = utf-8
"""
煎蛋图片下载队列
"""
import queue


class MyQueue:
    def __init__(self, start_page, end_page):
        self.page_list = range(start_page, end_page + 1)
        self.queue = queue.Queue(maxsize=0)
        self.push()

    def push(self):
        if len(self.page_list):
            for page in self.page_list:
                self.queue.put(page)

    def pop(self):
        return self.queue.get()


if __name__ == '__main__':
    page_queue = MyQueue(1, 20)
    while True:
        print(page_queue.pop())
